package com.quiz.bis.service;

import com.quiz.bis.domain.bo.ExamGroupApplyBo;
import com.quiz.bis.domain.bo.ExamGroupBo;
import com.quiz.bis.domain.vo.ExamGroupApplicationVo;
import com.quiz.common.core.domain.R;
import com.quiz.common.mybatis.core.page.PageQuery;
import com.quiz.common.mybatis.core.page.TableDataInfo;
import com.quiz.bis.domain.bo.ExamGroupQueryBo;
import com.quiz.bis.domain.vo.ExamGroupVo;


/**
 * 考试组服务接口
 * @author ahuan
 */
public interface IExamGroupService {
    TableDataInfo<ExamGroupVo> queryMainOwnerGroups(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    TableDataInfo<ExamGroupVo> querySecondaryOwnerGroups(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    TableDataInfo<ExamGroupVo> queryMemberGroups(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    TableDataInfo<ExamGroupVo> queryDisabledOrQuitGroups(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    TableDataInfo<ExamGroupVo> queryPendingInvites(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    R<Void> applyJoinGroup(ExamGroupApplyBo applyBo);
    R<Void> handleInvite(Long inviteId, boolean accept);
    R<Void> transferOwnership(Long groupId, Long newOwnerId);
    R<Void> quitGroup(Long groupId);
    R<Void> enableGroup(Long groupId, boolean enable);
    R<Void> deleteGroup(Long groupId);

    R<Long> addExamGroup(ExamGroupBo bo);
    R<Void> updateExamGroup(ExamGroupBo bo);

    TableDataInfo<ExamGroupVo> queryMemberGroupsOfStudent(ExamGroupQueryBo queryBo, PageQuery pageQuery);
    ExamGroupVo searchGroupByCode(String code);
    int studentJoinGroup(ExamGroupApplyBo applyBo);
    R<Void> quitGroupOfStudent(Long groupId);
    TableDataInfo<ExamGroupApplicationVo> listStudentApplications(Long userId, PageQuery pageQuery);
    boolean cancelApplication(Long userId, Long id);
    int cancelApplicationByRecordId(Long userId, Long id);
}